package edu.zju.gis.dbfg.server.service;


import edu.zju.gis.dbfg.common.Page;
import edu.zju.gis.dbfg.common.base.BaseFilter;
import edu.zju.gis.dbfg.common.base.BaseService;
import edu.zju.gis.dbfg.server.model.ParallelModel;
import edu.zju.gis.dbfg.server.model.ParallelModelWithBLOBs;
import edu.zju.gis.dbfg.server.model.vo.PublicModelsInfo;
import org.json.JSONArray;

import java.util.Collection;
import java.util.List;

public interface ParallelModelService extends BaseService<ParallelModelWithBLOBs, String> {
    List<ParallelModel> getByIdList(Collection<String> idList);

    default String getCmd(String artifactId, String jobName, List<String> params, List<String> envSetting) {
        ParallelModelWithBLOBs model = select(artifactId);
        return getCmd(model, jobName, params, envSetting);
    }

    String getCmd(ParallelModelWithBLOBs model, String jobName, List<String> params, List<String> envSetting);

    Page<ParallelModelWithBLOBs> search(BaseFilter params, Page page);

    Page<PublicModelsInfo> getAll(String userId,Page page);

    Page<PublicModelsInfo> selectByUserId(String userId, Page page);
    Page<ParallelModel> searchByClass(Collection<String> idList, Page page);

    int insert(ParallelModelWithBLOBs parallelModelWithBLOBs);
}
